~ function(window, document) {
    var VTextBox = function(selector, param) {
        if (!(this instanceof VTextBox)) return new VTextBox(selector, param);
        this.init(selector, param);
    }

    VTextBox.prototype = {
        _dom: null, // 获取的对象
        _selector: null,
        _param: {},
        constructor: VTextBox, // 构造函数
        // 原来DOM重新装载参数
        reload: function(param) {
            this._param = param;
        },
        // 事件委托实现绑定切换
        getParamDetail: function() {
            return {
                color: "颜色, 如 color: #333333",
                text: "内容, text: Hello World",
                fontSize: "文字大小, fontSize: 12px"
            }
        },
        trigger: function() {
            var _dom = this._dom;
            if (!_dom) {
                console.error("DOM对象不存在");
                return;
            }
            var _param = this._param;
            if (_param.color) {
                _dom.style.color = _param.color;
            }
            if (_param.text) {
                _dom.innerText = _param.text;
            }
            if (_param.fontSize) {
                _dom.style['font-size'] = _param.fontSize;
            }
        },
        getDom: function() {
            return this._dom;
        },
        // 初始化
        init: function(selector, param) {
            this._selector = selector || null;
            if (!this._selector) {
                console.error("选择器不存在");
                return;
            }
            this._dom = document.querySelector(selector);
            if (!this._dom) {
                console.error("DOM对象不存在");
                return;
            }
            this._param = param;
        }
    };
    window.VTextBox = VTextBox;
}(window, document);